package com.example.service.impl;

import com.example.entity.Course;
import com.example.mapper.CourseMapper;
import com.example.service.CourseService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CourseServiceImpl implements CourseService {
    @Autowired
    CourseMapper courseMapper;
    @Override
    public boolean list(String course_name, String course_teacher) {
        //查询条件对象
        QueryWrapper queryWrapper=new QueryWrapper();
        queryWrapper.eq("course_name",course_name);
        queryWrapper.eq("teacher_name",course_teacher);
        Course course = courseMapper.selectOne(queryWrapper);
        if(course !=null){
            return true;
        }
        return false;
    }
}
